<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>

      <!-- 通过字典方式来解决 -->
      <!-- <el-breadcrumb-item 
        v-for="(item, index) in $route.path.slice(1).split('/')"
        :key="index">
        {{ obj[item] }}
      </el-breadcrumb-item> -->

      <!-- 通过路由表中自定义字段 -->
      <el-breadcrumb-item 
        v-for="(item, index) in $route.meta.bread"
        :key="index">
        {{ item }}
      </el-breadcrumb-item>

      <!-- <el-breadcrumb-item>活动管理</el-breadcrumb-item>
      <el-breadcrumb-item>活动列表</el-breadcrumb-item>
      <el-breadcrumb-item>活动详情</el-breadcrumb-item> -->
    </el-breadcrumb>
  </div>
</template>

<script>
import Dic from './dictionaries'
export default {
    data() {
        return {
            obj: Dic
        }
    }
};
</script>

<style scoped>
.el-breadcrumb {
    font-size: 12px;
}
</style>